from django.db import models

# Create your models here.

class Cate(models.Model):
    name=models.CharField(max_length=32)

    class Meta:
        db_table='cate'


class Goods(models.Model):
    name=models.CharField(max_length=32)
    price=models.DecimalField(max_digits=9,decimal_places=2)
    img=models.ImageField(upload_to='img')
    grade=models.IntegerField(default=0)
    cate=models.ForeignKey(Cate,on_delete=models.CASCADE)

    class Meta:
        db_table='goods'



class Reserve(models.Model):
    name=models.CharField(max_length=32)
    count=models.IntegerField(default=0)
    reserve=models.CharField(max_length=32)
    address=models.CharField(max_length=128)
    phone=models.CharField(max_length=11)
    content=models.CharField(max_length=32)

    class Meta:
        db_table='reserve'

